<?php
/**
 * Created by PhpStorm.
 * User: Andy
 * Date: 2019/3/18
 * Time: 16:35
 */

namespace Common\helper;


class XmlHelper
{
    /**
     * xml 字符串 转为 json
     * @param $str
     * @return string
     */
    public static function xml2Json($str){
        $xmlArr=simplexml_load_string($str);
        return json_encode($xmlArr,true);
    }

}